import { type } from 'os';
import {
  Entity,
  PrimaryGeneratedColumn,
  ManyToMany,
  Column,
  JoinTable,
} from 'typeorm';
import { UsersEntity } from '../users/users.entity';

@Entity({ name: 'field' })
export class FieldEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @Column('varchar')
  name: string;

  @Column('varchar')
  label: string;

  @Column('int')
  busType: number; //{1:用户}

  @Column('int')
  fieldType: number; //{1:文本框，2：单选，3：多选，4：日期}

  @Column('int')
  isDefault: number;

  @Column('int')
  isRequire: number;

  @Column('int')
  isEnable: number;

  @Column('int')
  multiple: number;

  @Column('varchar')
  dateType: string;

  @Column('varchar')
  fieldOption: string;

  @Column('varchar')
  describe: string;

  @Column('varchar')
  placeholder: string;

  @Column({ type: 'varchar', nullable: true })
  regEx: string;

  @Column({ type: 'int', nullable: true })
  max: number;

  @Column({ type: 'int', nullable: true })
  min: number;

  @Column({ type: 'int', nullable: true })
  precision: number; //保留几位小数

  @Column('datetime')
  createDate: string;

  @Column('float')
  order: number;
}
